const { ethers } = require("hardhat")

async function  main() {

    const Task02 = await ethers.getContractFactory("Task02")
    console.log("begin deploy")
    const fundMe = await  Task02.deploy("MyToken", "MTK");
    await  fundMe.waitForDeployment()
    console.log(`contract has been deployed successfully, contract address is ${fundMe.target}`);



    const [firstAccount] = await ethers.getSigners()

    const fundTx = await fundMe.mint(firstAccount,ethers.parseEther("1"))

    console.log(await  fundMe.balanceOf(firstAccount))

}

main().then().catch(err => {
    console.error(err)
    process.exit(1)
})